package com.swq.java.code.chapter09.code10;

import com.swq.java.code.chapter09.code08.SpecialException;

public class WithFinally {
    public void methodA(int money) throws SpecialException {
        if (--money <= 0) throw new SpecialException("Out of money");
        System.out.println("methodA");
    }

    public static void main(String args[]) {
        try {
            new WithFinally().methodA(1);  //抛出SpecialException异常
            System.out.println("main");
        } catch (SpecialException e) {
            System.out.println("Wrong");
        } finally {
            System.out.println("Finally");
        }
    }
}
